package com.etcsoft.pagedesigner.common.log;

import org.slf4j.Logger;


/**
 * @author korman21@gmail.com
 *
 */
public class Slf4jLogger implements ILogger {
    private Logger logger;

    public Slf4jLogger(Logger logger) {
        this.logger = logger;
    }

    @Override
    public void debug(String message) {
        if (logger.isDebugEnabled()) {
            logger.debug(message);
        }
    }

    @Override
    public void trace(String message) {
        logger.trace(message);
    }

    @Override
    public void info(String message) {
        if (logger.isInfoEnabled()) {
            logger.info(message);
        }
    }

    @Override
    public void warn(String message) {
        if (logger.isWarnEnabled()) {
            logger.warn(message);
        }
    }

    @Override
    public void error(String message) {
        if (logger.isErrorEnabled()) {
            logger.error(message);
        }
    }

    @Override
    public void error(String message, Throwable e) {
        if (logger.isErrorEnabled()) {
            logger.error(message, e);
        }
    }

    @Override
    public void error(Throwable e) {
        logger.error("", e);
    }
}
